package cn.bytecollege.mapper;

import cn.bytecollege.model.UserAddress;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserAddressMapper extends BaseMapper<UserAddress> {
    @Insert("insert into user_address (user_id,address,real_name,telephone) " +
            "values (#{userId},#{address},#{realName},#{telephone})")
    int addAddress(UserAddress userAddress);
    @Update("update user_address set address=#{address},telephone=#{telephone},real_name=#{realName}" +
            " where user_id=#{userId} and user_address_id=#{userAddressId}")
    int modById(UserAddress userAddress);
}
